package org.tis.tools.abf.module.ac.entity.vo;

import lombok.Data;
import org.tis.tools.abf.module.ac.entity.AcMenu;
import org.tis.tools.abf.module.ac.entity.AcOperatorMenu;
import org.tis.tools.abf.module.ac.entity.enums.AcOpenMode;
import org.tis.tools.abf.module.common.entity.enums.YON;
import org.tis.tools.core.utils.StringUtil;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by chenchao
 * Created on 2018/9/26 14:17
 */
@Data
public class AcOperatorMenuUiEntityDetail {

    private String guid;
    private String guidOperator;
    private String guidApp;
    private String guidFunc;
    private String menuName;
    private String menuLabel;
    private String guidParents;
    private YON isleaf;
    private BigDecimal menuLevel;
    private String guidRoot;
    private BigDecimal displayOrder;
    private String imagePath;
    private String expandPath;
    private String menuSeq;
    private AcOpenMode openMode;
    private BigDecimal subCount;
    private Date createtime;
    private Date lastupdate;
    private String updator;
    private String dataStatus;
    private String uiEntry;

    public AcOperatorMenuUiEntityDetail(){}

    public AcOperatorMenuUiEntityDetail(AcOperatorMenu acMenu,String uiEntry){
        this.guid = acMenu.getGuid();
        this.guidOperator = acMenu.getGuidOperator();
        this.guidApp = acMenu.getGuidApp();
        this.guidFunc = acMenu.getGuidFunc();
        this.menuName = StringUtil.isNotEmpty(acMenu.getMenuLabel()) ? acMenu.getMenuLabel() : acMenu.getMenuName();
        this.menuLabel = acMenu.getMenuLabel();
        this.guidParents = acMenu.getGuidParents();
        this.isleaf = acMenu.getIsleaf();
        this.menuLevel = acMenu.getMenuLevel();
        this.guidRoot = acMenu.getGuidRoot();
        this.displayOrder = acMenu.getDisplayOrder();
        this.imagePath = acMenu.getImagePath();
        this.expandPath = acMenu.getExpandPath();
        this.menuSeq = acMenu.getMenuSeq();
        this.openMode = acMenu.getOpenMode();
        this.subCount = acMenu.getSubCount();
        this.createtime = acMenu.getCreatetime();
        this.lastupdate = acMenu.getLastupdate();
        this.updator = acMenu.getUpdator();
        this.dataStatus = acMenu.getDataStatus();
        this.uiEntry = uiEntry;
    }

    public AcOperatorMenuUiEntityDetail(AcMenu acMenu, String uiEntry){
        this.guid = acMenu.getGuid();
        this.guidApp = acMenu.getGuidApp();
        this.guidFunc = acMenu.getGuidFunc();
        this.menuName = StringUtil.isNotEmpty(acMenu.getMenuLabel()) ? acMenu.getMenuLabel() : acMenu.getMenuName();
        this.menuLabel = acMenu.getMenuLabel();
        this.guidParents = acMenu.getGuidParents();
        this.isleaf = acMenu.getIsleaf();
        this.menuLevel = acMenu.getMenuLevel();
        this.guidRoot = acMenu.getGuidRoot();
        this.displayOrder = acMenu.getDisplayOrder();
        this.imagePath = acMenu.getImagePath();
        this.expandPath = acMenu.getExpandPath();
        this.menuSeq = acMenu.getMenuSeq();
        this.createtime = acMenu.getCreatetime();
        this.lastupdate = acMenu.getLastupdate();
        this.updator = acMenu.getUpdator();
        this.dataStatus = acMenu.getDataStatus();
        this.uiEntry = uiEntry;
    }
}
